﻿//using Newtonsoft.Json;
//using NWMES.DataCollectForResourceFAIServiceService;
//using NWMES.MachineIntegrationServiceService;
//using NWMES.MiAssembleAndCollectDataForSfcServiceService;
//using NWMES.MiFindCustomAndSfcDataServiceService;
//using NWMES.Model.Result;
//using NWMES.Model;
//using NWMES;
//using SharpConfig;
//using SHMES.MachineIntegrationServiceService;
//using SHMES.MiFindCustomAndSfcDataServiceService;
//using SHMES.Model;
//using SHMES.Model.Result;
//using SHMES.Utils;
//using System;
//using System.Collections.Generic;
//using System.IO;
//using System.Linq;
//using System.Net;
//using System.Text;
//using System.Threading.Tasks;


//namespace SHMES
//{
//    public static class MesInterface
//    {
//        static private CfgMiFindCustomAndSfcDataServiceService cfgMiFindCustomAndSfcDataServiceService;
//        static private CfgDataCollectForResourceInspectTaskServiceService cfgDataCollectForResourceInspectTaskServiceService;
//        static private CfgMiAssembleAndCollectDataForSfcServiceService cfgMiAssembleAndCollectDataForSfcServiceService;
//        static private CfgMachineIntegrationServiceService cfgMachineIntegrationServiceService;
//        static private CfgDataCollectForResourceFAIServiceService cfgDataCollectForResourceFAIServiceService;

//        #region Service
//        static private NetworkCredential NC;
//        static private MachineIntegrationServiceService.MachineIntegrationServiceService MachineIntegrationService;//MES出站
//        static private MiFindCustomAndSfcDataServiceService.MiFindCustomAndSfcDataServiceService MiFindCustomAndSfcDataService;//进站
//        static private MiAssembleAndCollectDataForSfcServiceService.MiAssembleAndCollectDataForSfcServiceService MiAssembleAndCollectDataForSfcService;//物料扣料
//        static private DataCollectForResourceFAIServiceService.DataCollectForResourceFAIServiceService DataCollectForResourceFAIService;//首件
//        static private string logfilePath = @"E:\MESLOG\";
//        #endregion
//        static MesInterface()
//        {
//            Configuration.IgnoreInlineComments = true;

//            Configuration config = Configuration.LoadFromFile("MESCFG.ini");

//            string cfgLogFilePath = config["MesLog"]["SavePath"].RawValue;
//            if (!string.IsNullOrWhiteSpace(cfgLogFilePath))
//            {
//                logfilePath = cfgLogFilePath;
//            }


//            var cfgNetworkCredential = config["NetworkCredential"].ToObject<CfgNetworkCredential>();
//            cfgMiFindCustomAndSfcDataServiceService = config["MiFindCustomAndSfcDataServiceService"].ToObject<CfgMiFindCustomAndSfcDataServiceService>();
//            cfgDataCollectForResourceInspectTaskServiceService = config["DataCollectForResourceInspectTaskServiceService"].ToObject<CfgDataCollectForResourceInspectTaskServiceService>();
//            cfgMiAssembleAndCollectDataForSfcServiceService = config["MiAssembleAndCollectDataForSfcServiceService"].ToObject<CfgMiAssembleAndCollectDataForSfcServiceService>();
//            cfgMachineIntegrationServiceService = config["MachineIntegrationServiceService"].ToObject<CfgMachineIntegrationServiceService>();
//            cfgDataCollectForResourceFAIServiceService = config["DataCollectForResourceFAIServiceService"].ToObject<CfgDataCollectForResourceFAIServiceService>();

//            string user = cfgNetworkCredential.User;
//            string password = cfgNetworkCredential.Password;
//            NC = new NetworkCredential(user, password, null);
//            // ---
//            //cfgMiFindCustomAndSfcDataServiceService = MesConfig.SetPNParams();
//            // cfgDataCollectForResourceInspectTaskServiceService = config["DataCollectForResourceInspectTaskServiceService"].ToObject<CfgDataCollectForResourceInspectTaskServiceService>();
//            //cfgMiAssembleAndCollectDataForSfcServiceService = config["MiAssembleAndCollectDataForSfcServiceService"].ToObject<CfgMiAssembleAndCollectDataForSfcServiceService>();
//            //cfgMachineIntegrationServiceService = config["MachineIntegrationServiceService"].ToObject<CfgMachineIntegrationServiceService>();
//            //cfgDataCollectForResourceFAIServiceService = config["DataCollectForResourceFAIServiceService"].ToObject<CfgDataCollectForResourceFAIServiceService>();



//            Init();
//        }

//        public static void Init()
//        {
//            //Configuration.IgnoreInlineComments = true;

//            //Configuration config = Configuration.LoadFromFile("MESCFG.ini");

//            //string cfgLogFilePath = config["MesLog"]["SavePath"].RawValue;
//            //if (!string.IsNullOrWhiteSpace(cfgLogFilePath))
//            //{
//            //    logfilePath = cfgLogFilePath;
//            //}


//            //var cfgNetworkCredential = config["NetworkCredential"].ToObject<CfgNetworkCredential>();
//            //cfgMiFindCustomAndSfcDataServiceService = config["MiFindCustomAndSfcDataServiceService"].ToObject<CfgMiFindCustomAndSfcDataServiceService>();
//            //cfgDataCollectForResourceInspectTaskServiceService = config["DataCollectForResourceInspectTaskServiceService"].ToObject<CfgDataCollectForResourceInspectTaskServiceService>();
//            //cfgMiAssembleAndCollectDataForSfcServiceService = config["MiAssembleAndCollectDataForSfcServiceService"].ToObject<CfgMiAssembleAndCollectDataForSfcServiceService>();
//            //cfgMachineIntegrationServiceService = config["MachineIntegrationServiceService"].ToObject<CfgMachineIntegrationServiceService>();
//            //cfgDataCollectForResourceFAIServiceService = config["DataCollectForResourceFAIServiceService"].ToObject<CfgDataCollectForResourceFAIServiceService>();


//            // ---
//            //cfgMiFindCustomAndSfcDataServiceService = MesConfig.SetPNParams();
//            // cfgDataCollectForResourceInspectTaskServiceService = config["DataCollectForResourceInspectTaskServiceService"].ToObject<CfgDataCollectForResourceInspectTaskServiceService>();
//            //cfgMiAssembleAndCollectDataForSfcServiceService = config["MiAssembleAndCollectDataForSfcServiceService"].ToObject<CfgMiAssembleAndCollectDataForSfcServiceService>();
//            //cfgMachineIntegrationServiceService = config["MachineIntegrationServiceService"].ToObject<CfgMachineIntegrationServiceService>();
//            //cfgDataCollectForResourceFAIServiceService = config["DataCollectForResourceFAIServiceService"].ToObject<CfgDataCollectForResourceFAIServiceService>();






//            //cfgMachineIntegrationServiceService.dcGroupRevision = "#";
//            //cfgMachineIntegrationServiceService.operationRevision = "#";

//            //string user = cfgNetworkCredential.User; ;
//            //string password = cfgNetworkCredential.Password;
//            //   NC = new NetworkCredential(user, password, null);
//            if (string.IsNullOrEmpty(cfgMachineIntegrationServiceService.Url))
//            {
//                return;
//            }
//            MachineIntegrationService = new MachineIntegrationServiceService.MachineIntegrationServiceService
//            {
//                Credentials = NC,
//                Url = cfgMachineIntegrationServiceService.Url,
//                Timeout = cfgMachineIntegrationServiceService.Timeout,
//                PreAuthenticate = true,
//            };

//            MiFindCustomAndSfcDataService = new MiFindCustomAndSfcDataServiceService.MiFindCustomAndSfcDataServiceService
//            {
//                Credentials = NC,
//                Url = cfgMiFindCustomAndSfcDataServiceService.Url,
//                Timeout = cfgMiFindCustomAndSfcDataServiceService.Timeout,
//                PreAuthenticate = true
//            };

//            MiAssembleAndCollectDataForSfcService = new MiAssembleAndCollectDataForSfcServiceService.MiAssembleAndCollectDataForSfcServiceService
//            {
//                Credentials = NC,
//                Url = cfgMiAssembleAndCollectDataForSfcServiceService.Url,
//                Timeout = cfgMiAssembleAndCollectDataForSfcServiceService.Timeout,
//                PreAuthenticate = true
//            };

//            //出战
//            MachineIntegrationService = new MachineIntegrationServiceService.MachineIntegrationServiceService()
//            {
//                Credentials = NC,
//                Url = cfgMachineIntegrationServiceService.Url,
//                Timeout = Convert.ToInt32(cfgMachineIntegrationServiceService.Timeout),
//                PreAuthenticate = true,
//            };

//            //首件
//            DataCollectForResourceFAIService = new DataCollectForResourceFAIServiceService.DataCollectForResourceFAIServiceService()
//            {
//                Credentials = NC,
//                Url = cfgDataCollectForResourceFAIServiceService.Url,
//                Timeout = Convert.ToInt32(cfgDataCollectForResourceFAIServiceService.Timeout),
//                PreAuthenticate = true,
//            };
//        }

//        public static void Init(CfgMiFindCustomAndSfcDataServiceService PnConfig, CfgMachineIntegrationServiceService UploadConfig)
//        {
//            cfgMiFindCustomAndSfcDataServiceService = PnConfig;
//            cfgMachineIntegrationServiceService = UploadConfig;
//            NC = new NetworkCredential(PnConfig.UserName, PnConfig.Password, null);
//            Init();
//        }
//        /// <summary>
//        /// MES进站 
//        /// 
//        /// 获取PN
//        /// 
//        /// </summary>
//        /// <param name="resource">设备</param>
//        /// <param name="ProductSfc">模组条码</param>
//        /// <param name="CurrentOperation">工序</param>
//        /// <returns></returns>
//        static public FindCustomAndSfcDataResult MESGetModeSfc(string sfc)
//        {
//            return MESGetModeSfc(sfc, cfgMiFindCustomAndSfcDataServiceService.resource, cfgMiFindCustomAndSfcDataServiceService.operation);
//        }

//        /// <summary>
//        /// MES出站 
//        /// 
//        /// 上传数据
//        /// 
//        /// </summary>
//        /// <param name="sfc">模组条码</param>
//        /// <returns></returns>
//        static public MesResult MESStationOut(string sfc, List<KeyValuePair<string, string>> data, string dcGroup, string complete)
//        {
//            return MESStationOut(sfc, cfgMachineIntegrationServiceService.resource,
//                cfgMachineIntegrationServiceService.operation, data, dcGroup, complete);
//        }


//        /// <summary>
//        /// MES进站
//        /// </summary>
//        /// <param name="resource">设备</param>
//        /// <param name="ProductSfc">模组条码</param>
//        /// <param name="CurrentOperation">工序</param>
//        /// <returns></returns>
//        static public FindCustomAndSfcDataResult MESGetModeSfc(string sfc, string resource, string operation)
//        {

//            var result = FindCustomAndSfcDataResult.GetNew();
//            var req = new miFindCustomAndSfcData
//            {
//                FindCustomAndSfcDataRequest = new findCustomAndSfcDataRequest
//                {
//                    site = cfgMiFindCustomAndSfcDataServiceService.site,
//                    user = cfgMiFindCustomAndSfcDataServiceService.user,
//                    operationRevision = cfgMiFindCustomAndSfcDataServiceService.operationRevision,
//                    activity = cfgMiFindCustomAndSfcDataServiceService.activity,
//                    findSfcByInventory = cfgMiFindCustomAndSfcDataServiceService.findSfcByInventory, //true为PN,false为模组码
//                    //sfcOrder = cfgMiFindCustomAndSfcDataServiceService.sfcOrder,
//                    //targetOrder = cfgMiFindCustomAndSfcDataServiceService.targetOrder,
//                    modeProcessSFC = (MiFindCustomAndSfcDataServiceService.modeProcessSFC)Enum.Parse(typeof(MiFindCustomAndSfcDataServiceService.modeProcessSFC), cfgMiFindCustomAndSfcDataServiceService.modeProcessSFC),

//                    masterDataArray = new MiFindCustomAndSfcDataServiceService.ObjectAliasEnum[1] {
//                        MiFindCustomAndSfcDataServiceService.ObjectAliasEnum.ITEM
//                    },
//                    customDataArray = new MiFindCustomAndSfcDataServiceService.customDataInParametricData[1]
//                        {
//                            new MiFindCustomAndSfcDataServiceService.customDataInParametricData() {
//                                category = MiFindCustomAndSfcDataServiceService.ObjectAliasEnum.ITEM,
//                                dataField = "XPXS"
//                        },
//                    }
//                }
//            };

//            req.FindCustomAndSfcDataRequest.operation = operation;
//            req.FindCustomAndSfcDataRequest.resource = resource;
//            req.FindCustomAndSfcDataRequest.sfc = sfc;//电芯条码

//            var mesLog = new MesLogRec()
//            {
//                BeginTime = DateTime.Now,
//                Request = JsonConvert.SerializeObject(req),
//            };

//            try
//            {
//                result.BeginTime = DateTime.Now;
//                var resp = MiFindCustomAndSfcDataService.miFindCustomAndSfcData(req);

//                mesLog.EndTime = DateTime.Now;
//                mesLog.Respone = JsonConvert.SerializeObject(resp);
//                mesLog.Code = resp?.@return?.code;
//                mesLog.Message = resp?.@return?.message;


//                if (resp.@return != null)
//                {
//                    var ret = resp.@return;
//                    result.Message = ret.message;
//                    result.Code = ret.code;

//                    if (ret.code == 0)
//                    {
//                        result.Success = true;
//                        //成功的逻辑
//                        result.Data = new FindCustomAndSfcDataResultData()
//                        {
//                            Master = ret.masterDataArray?.FirstOrDefault()?.value,
//                            XPXS = ret.customDataArray?.FirstOrDefault(a => a.dataField == "XPXS")?.dataAttribute,
//                        };
//                    }
//                    else
//                    {

//                    }
//                }
//            }
//            catch (Exception ex)
//            {
//                result.EndTime = DateTime.Now;
//                result.HasException = true;
//                result.ExMessage = " Exception::" + ex.ToString();
//            }


//            MES_SaveLog(logfilePath, "MiFindCustomAndSfcData", mesLog);

//            return result;
//        }

//        /// <summary>
//        /// MES出站（不带数据）
//        /// </summary>
//        /// <param name="ProductSfc">模组条码</param>
//        /// <returns></returns>
//        static public MesResult MESStationOutWithParam(string sfc)
//        {
//            return MESStationOutWithParam(sfc, cfgMachineIntegrationServiceService.resource, cfgMachineIntegrationServiceService.operation);
//        }

//        /// <summary>
//        /// MES出站（不带数据）
//        /// </summary>
//        /// <param name="ProductSfc">模组条码</param>
//        /// <returns></returns>
//        static public MesResult MESStationOutWithParam(string sfc, string resource, string operation)
//        {
//            var result = MesResult.GetNew();

//            var req = new MachineIntegrationServiceService.sfcComplete
//            {
//                CompleteSfcRequest = new MachineIntegrationServiceService.completeSfcRequest
//                {
//                    operationRevision = cfgMachineIntegrationServiceService.operationRevision,
//                    site = cfgMachineIntegrationServiceService.site,
//                    //user =
//                    operation = resource,
//                    resource = operation,
//                    sfcArray = new string[] { sfc }
//                }
//            };

//            var mesLog = new MesLogRec()
//            {
//                BeginTime = DateTime.Now,
//                Request = JsonConvert.SerializeObject(req),
//            };

//            try
//            {
//                result.BeginTime = DateTime.Now;
//                var resp = MachineIntegrationService.sfcComplete(req);
//                result.EndTime = DateTime.Now;

//                mesLog.EndTime = DateTime.Now;
//                mesLog.Respone = JsonConvert.SerializeObject(resp);
//                mesLog.Code = resp?.@return?.code;
//                mesLog.Message = resp?.@return?.message;

//                if (resp.@return != null)
//                {
//                    var ret = resp.@return;
//                    result.Message = ret.message;
//                    result.Code = ret.code;

//                    if (ret.code == 0)
//                    {
//                        result.Success = true;
//                        //成功的逻辑
//                    }
//                    else
//                    {
//                    }
//                }
//                else
//                {
//                }
//            }
//            catch (Exception ex)
//            {
//                result.EndTime = DateTime.Now;
//                result.HasException = true;
//                result.ExMessage = " Exception::" + ex.ToString();
//            }
//            MES_SaveLog(logfilePath, "SfcComplete", mesLog);

//            return result;

//        }


//        /// <summary>
//        /// MES出站
//        /// </summary>
//        /// <param name="sfc">模组条码</param>
//        /// <returns></returns>
//        static public MesResult MESStationOut(string sfc, string resource, string operation,
//            List<KeyValuePair<string, string>> data, string dcGroup, string complete)
//        {
//            var result = MesResult.GetNew();

//            var req = new MachineIntegrationServiceService.dataCollectForSfcEx
//            {
//                SfcDcExRequest = new MachineIntegrationServiceService.sfcDcExRequest
//                {
//                    activityId = cfgMachineIntegrationServiceService.activityId,
//                    dcGroup = cfgMachineIntegrationServiceService.dcGroup,
//                    dcGroupRevision = cfgMachineIntegrationServiceService.dcGroupRevision,
//                    isDispositionRequired = cfgMachineIntegrationServiceService.isDispositionRequired,
//                    isDispositionRequiredSpecified = cfgMachineIntegrationServiceService.isDispositionRequiredSpecified,
//                    isGetSFCFromCustomerBarcode = cfgMachineIntegrationServiceService.isGetSFCFromCustomerBarcode,
//                    modeProcessSfc = cfgMachineIntegrationServiceService.modeProcessSFC.ToEnum<MachineIntegrationServiceService.ModeProcessSfc>(),
//                    operationRevision = cfgMachineIntegrationServiceService.operationRevision,
//                    site = cfgMachineIntegrationServiceService.site,
//                    user = cfgMachineIntegrationServiceService.user,

//                    operation = operation,
//                    resource = resource,
//                    sfc = sfc,
//                    parametricDataArray = data.Select(a => new MachineIntegrationServiceService.machineIntegrationParametricData() { name = a.Key, value = a.Value }).ToArray(),
//                }
//            };

//            var mesLog = new MesLogRec()
//            {
//                BeginTime = DateTime.Now,
//                Request = JsonConvert.SerializeObject(req),
//            };
//            //上盖*C,前面板*D
//            //req.SfcDcExRequest.dcGroup = dcGroup;
//            if (!string.IsNullOrEmpty(dcGroup))
//            {
//                req.SfcDcExRequest.dcGroup = dcGroup;
//            }
//            if (!string.IsNullOrEmpty(complete))
//            {
//                req.SfcDcExRequest.modeProcessSfc = complete.ToEnum<ModeProcessSfc>();
//            }
//            try
//            {
//                result.BeginTime = DateTime.Now;
//                var resp = MachineIntegrationService.dataCollectForSfcEx(req);
//                result.EndTime = DateTime.Now;

//                mesLog.EndTime = DateTime.Now;
//                mesLog.Respone = JsonConvert.SerializeObject(resp);
//                mesLog.Code = resp?.@return?.code;
//                mesLog.Message = resp?.@return?.message;

//                if (resp.@return != null)
//                {
//                    if (resp.@return.code == 0)
//                    {
//                        result.Success = true;
//                        //成功的逻辑
//                    }
//                    else
//                    {
//                        result.Success = false;
//                        result.Code = resp.@return.code;
//                        result.Message = resp?.@return?.message;
//                    }
//                }
//                else
//                {

//                }
//            }
//            catch (Exception ex)
//            {
//                result.EndTime = DateTime.Now;
//                result.HasException = true;
//                result.ExMessage = " Exception::" + ex.ToString();
//            }

//            MES_SaveLog(logfilePath, "DataCollectForSfcEx", mesLog);

//            return result;
//        }



//        /// <summary>
//        /// 首件
//        /// </summary>
//        /// <param name="sfc"></param>
//        /// <param name="resource"></param>
//        /// <param name="operation"></param>
//        /// <param name="data"></param>
//        /// <returns></returns>
//        static public MesResult MESFAI(string sfc, string resource, string operation, List<KeyValuePair<string, string>> data)
//        {
//            var result = MesResult.GetNew();

//            var req = new DataCollectForResourceFAIServiceService.dataCollectForResourceFAI
//            {
//                resourceRequest = new DataCollectForResourceFAIServiceService.dataCollectForResourceFAIRequest
//                {
//                    dcGroupSequence = sfc,
//                    dcMode = cfgDataCollectForResourceFAIServiceService.dcMode,
//                    material = cfgDataCollectForResourceFAIServiceService.material,
//                    materialRevision = cfgDataCollectForResourceFAIServiceService.materialRevision,
//                    dcGroup = cfgDataCollectForResourceFAIServiceService.dcGroup,
//                    dcGroupRevision = cfgDataCollectForResourceFAIServiceService.dcGroupRevision,
//                    operationRevision = cfgDataCollectForResourceFAIServiceService.operationRevision,
//                    site = cfgDataCollectForResourceFAIServiceService.site,
//                    user = cfgDataCollectForResourceFAIServiceService.user,
//                    operation = operation,
//                    resource = resource,
//                    sfc = sfc,

//                    parametricDataArray = data.Select(d => new DataCollectForResourceFAIServiceService.machineIntegrationParametricData
//                    {
//                        name = d.Key,
//                        value = d.Value,
//                        dataType = DataCollectForResourceFAIServiceService.ParameterDataType.NUMBER
//                    }).ToArray()
//                }
//            };

//            var mesLog = new MesLogRec()
//            {
//                BeginTime = DateTime.Now,
//                Request = JsonConvert.SerializeObject(req),
//            };


//            try
//            {
//                result.BeginTime = DateTime.Now;
//                var resp = DataCollectForResourceFAIService.dataCollectForResourceFAI(req);
//                result.EndTime = DateTime.Now;

//                mesLog.EndTime = DateTime.Now;
//                mesLog.Respone = JsonConvert.SerializeObject(resp);
//                mesLog.Code = resp?.@return?.code;
//                mesLog.Message = resp?.@return?.message;

//                if (resp.@return != null)
//                {
//                    if (resp.@return.code == 0)
//                    {
//                        result.Success = true;
//                        //成功的逻辑
//                    }
//                    else
//                    {
//                    }
//                }
//                else
//                {

//                }
//            }
//            catch (Exception ex)
//            {
//                result.EndTime = DateTime.Now;
//                result.HasException = true;
//                result.ExMessage = " Exception::" + ex.ToString();
//            }

//            MES_SaveLog(logfilePath, "DataCollectForSfcEx", mesLog);

//            return result;
//        }


//        static object mesLogLock = new object();


//        private static string GetObjCsvStr(object resp)
//        {
//            return "\"" + JsonConvert.SerializeObject(resp).Replace("\"", "\"\"") + "\"";
//        }
//        private static string GetObjCsvStr(string resp)
//        {
//            resp = resp ?? "";
//            return "\"" + resp.Replace("\"", "\"\"") + "\"";
//        }
//        static private bool MES_SaveLog(string filePath, string interfaceName, MesLogRec log)
//        {
//            var cols = new List<string>() {
//            "传参",
//            "调用开始时间",
//            "调用结束时间",
//            "返回",
//            "Code",
//            "Message",
//            };

//            lock (mesLogLock)
//            {
//                bool saveComp = false;
//                try
//                {
//                    string dirPath = Path.Combine(filePath, interfaceName);

//                    if (!Directory.Exists(dirPath))
//                    {
//                        Directory.CreateDirectory(dirPath);
//                    }
//                    //FileStream fs = new FileStream(lujing2 + "\\" + _moduleSn + ".csv", FileMode.Create);
//                    //StreamWriter sw = new StreamWriter(fs, Encoding.GetEncoding("GB2312"));
//                    var fullPath = Path.Combine(dirPath, $"{DateTime.Now:yyyyMMdd}.csv");
//                    if (!File.Exists(fullPath))
//                    {
//                        var titleLine = string.Join(",", cols) + "\r\n";

//                        File.AppendAllText(fullPath, titleLine, Encoding.GetEncoding("GB2312"));
//                    }

//                    var paraList = new List<string>() {
//                        GetObjCsvStr(log.Request),
//                        log.BeginTime.ToString(),
//                        log.EndTime.ToString(),
//                        GetObjCsvStr(log.Respone),
//                        log.Code.ToString(),
//                        GetObjCsvStr(log.Message)
//                    };

//                    var dataLine = string.Join(",", paraList.Select(a => a)) + "\r\n";


//                    File.AppendAllText(fullPath, dataLine, Encoding.GetEncoding("GB2312"));
//                    saveComp = true;
//                }
//                catch (IOException ex)
//                {
//                    saveComp = false;
//                    Console.WriteLine(ex.Message);
//                }
//                return saveComp;
//            }
//        }
//        /// <summary>
//        /// 包含以下字段：
//        ///传参
//        ///调用开始时间
//        ///调用结束时间
//        ///返回
//        ///Code
//        ///Message
//        /// </summary>
//        class MesLogRec
//        {
//            public string Request { get; set; }
//            public string Respone { get; set; }
//            public DateTime BeginTime { get; set; }
//            public DateTime EndTime { get; set; }
//            public int? Code { get; set; }
//            public string Message { get; set; }

//        }

//    }
//}
